/* ============================================
   NEWS ARTICLES - BLOG TEMPLATE
   ============================================
*/

/* ============================================
   FILTER BAR (Listing mode)
   ============================================
*/

.blog-filter-bar {
    display: flex;
    gap: 1rem;
    align-items: center;
    flex-wrap: wrap;
    padding: 1.5rem 2rem;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    margin-bottom: 2rem;
}

.blog-filter-label {
    font-weight: 600;
    color: var(--color-brand);
    font-size: 0.95rem;
    margin-right: 0.25rem;
}

.blog-filter-btn,
a.blog-filter-btn:link,
a.blog-filter-btn:visited {
    display: inline-block;
    padding: 0.4rem 1.1rem;
    border-radius: 50px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #555;
    font-weight: 500;
    font-size: 0.9rem;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.blog-filter-btn:hover,
.blog-filter-btn.active {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: white;
}

/* ============================================
   LISTING HEADER
   ============================================
*/

#news-listing-header,
#news-category-header {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--color-brand);
    margin: 0 0 2rem 0;
    text-align: center;
}

/* ============================================
   LISTING - Card Grid
   ============================================
*/

.news-listing {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
}

/* ============================================
   BLOG CARD (shared by listing + related)
   ============================================
*/

.blog-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blog-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(19, 80, 45, 0.15);
}

/* Card image */
.blog-card-image {
    line-height: 0;
}

.blog-card-image a {
    display: block;
}

.blog-card-image img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    display: block;
}

/* Card body */
.blog-card-body {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.blog-card p.summary {
    display: -webkit-box; /* Required: uses the old flexbox model */
    -webkit-box-orient: vertical; /* Required: sets the direction of the box */
    -webkit-line-clamp: 3; /* The number of lines to display */
    overflow: hidden; /* Required: hides the remaining text */
}

/* Category tag pill */
.post-tag {
    display: inline-block;
    padding: 0.25rem 0.9rem;
    background: #e8f5ee;
    color: var(--color-brand);
    border-radius: 50px;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    margin-bottom: 0.8rem;
}

.post-tag:empty {
    display: none;
}

/* Card title */
.blog-card-body h3 {
    font-size: 1.15rem;
    color: var(--color-brand);
    margin-bottom: 0.7rem;
    line-height: 1.4;
    flex: 0;
}

.blog-card-body h3 a {
    color: var(--color-brand);
    text-decoration: none;
    transition: color 0.2s ease;
}

.blog-card-body h3 a:hover {
    color: var(--color-brand);
}

/* Card excerpt */
.blog-card-body p {
    font-size: 0.92rem;
    color: #666;
    line-height: 1.65;
    flex: 1;
    margin-bottom: 1rem;
}

/* Card footer: author + date + read link */
.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 1rem;
    border-top: 1px solid #f0f0f0;
    margin-top: auto;
}

.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 0.82rem;
    color: #666;
}

/* Author initials avatar */
.meta-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-weight: 700;
    font-size: 0.68rem;
    flex-shrink: 0;
}

/* Read link */
a.card-read-more,
a.card-read-more:link,
a.card-read-more:visited {
    color: var(--color-brand-light);
    font-weight: 600;
    font-size: 0.88rem;
    text-decoration: none;
    transition: color 0.2s ease;
    white-space: nowrap;
}

a.card-read-more:hover {
    color: var(--color-brand);
}

/* ============================================
   ARTICLE LAYOUT (two-column: article + sidebar)
   ============================================
*/

.article-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 3rem;
    align-items: start;
    padding-top: 2rem;
}

.article-main {
    min-width: 0;
}

/* Sidebar */
.article-sidebar {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* Green gradient CTA card */
.sidebar-cta {
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
    color: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 8px 30px rgba(19, 80, 45, 0.2);
}

.sidebar-cta h3 {
    color: white;
    font-size: 1.2rem;
    margin: 0 0 0.8rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

.sidebar-cta p {
    opacity: 0.9;
    font-size: 0.92rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

a.sidebar-cta-btn,
a.sidebar-cta-btn:link,
a.sidebar-cta-btn:visited {
    display: block;
    text-align: center;
    padding: 0.8rem 1.5rem;
    background: white;
    color: var(--color-brand);
    font-weight: 700;
    border-radius: 50px;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.sidebar-cta-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    color: var(--color-brand);
}

/* White card (Topics) */
.sidebar-card {
    background: white;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    padding: 1.8rem;
}

.sidebar-card h3 {
    color: var(--color-brand);
    font-size: 1.1rem;
    font-weight: 700;
    margin: 0 0 1.2rem 0;
    padding-bottom: 0.6rem;
    border-bottom: 3px solid #e8f5ee;
}

/* Topics tag cloud */
.tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.tag-chip,
a.tag-chip,
a.tag-chip:link,
a.tag-chip:visited {
    padding: 0.3rem 0.9rem;
    background: #e8f5ee;
    color: var(--color-brand);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

a.tag-chip:hover {
    background: var(--color-brand);
    color: white;
}

/* [CATEGORIES] token renders <a> links — style them as chips */
.tags-cloud a {
    padding: 0.3rem 0.9rem;
    background: #e8f5ee;
    color: var(--color-brand);
    border-radius: 50px;
    font-size: 0.82rem;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
}

.tags-cloud a:hover {
    background: var(--color-brand);
    color: white;
}

/* ============================================
   ARTICLE VIEW
   ============================================
*/

/* Fallback header (shown without JS) */
#blog-article-header-fallback {
    margin-bottom: 1.5rem;
}

.blog-article-title {
    font-size: 2.2rem;
    color: var(--color-text);
    margin: 0 0 0.75rem 0;
    line-height: 1.3;
}

.blog-article-view .publishdate {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

/* Back button */
a.back-button,
a.back-button:link,
a.back-button:visited {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: var(--color-brand);
    color: white;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1.75rem;
    transition: background 0.2s ease, transform 0.2s ease;
}

a.back-button:hover {
    background: var(--color-brand-light);
    color: white;
    transform: translateX(-4px);
}

/* Article body card */
.article-body {
    background: white;
    padding: 3rem;
    border-radius: 15px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    margin-bottom: 3rem;
}

/* Article body text */
.article-body .details {
    font-size: 1.05rem;
    line-height: 1.85;
    color: #555;
}

.article-body .details h2,
.article-body .details h3,
.article-body .details h4 {
    color: var(--color-brand);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
}

.article-body .details h2 {
    font-size: 1.6rem;
    padding-bottom: 0.5rem;
    border-bottom: 3px solid #e8f5ee;
}

.article-body .details h3 {
    font-size: 1.2rem;
}

.article-body .details p {
    margin-bottom: 1.4rem;
}

.article-body .details li p {
    margin-bottom: 0.5rem;
}

.article-body .details img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1rem 0;
}

.article-body .details .alignleft {
    float: left;
    margin: 0 20px 20px;
}

.article-body .details .alignright {
    float: right;
    margin: 0 0 20px 20px;
}

.article-body .details blockquote {
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
    color: white;
    padding: 1.75rem 2rem 1.75rem 3rem;
    border-radius: 12px;
    margin: 2rem 0;
    font-size: 1.1rem;
    font-style: italic;
    line-height: 1.7;
    position: relative;
}

.article-body .details blockquote::before {
    content: '\201C';
    font-size: 5rem;
    line-height: 1;
    position: absolute;
    top: -0.5rem;
    left: 1.25rem;
    opacity: 0.25;
    font-family: Georgia, serif;
    font-style: normal;
}

/* Highlight box (checklist / callout box) */
.article-body .details .highlight-box {
    background: #f5f7fa;
    padding: 2rem 2.5rem;
    border-radius: 15px;
    border-left: 4px solid var(--color-brand);
    margin: 2rem 0;
}

.article-body .details .highlight-box h3 {
    color: var(--color-brand);
    margin-top: 0;
    margin-bottom: 1rem;
    border-bottom: none;
    padding-bottom: 0;
}

.article-body .details .highlight-box ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.article-body .details .highlight-box ul li {
    padding: 0.4rem 0 0.4rem 1.5rem;
    color: #555;
    position: relative;
    font-size: 1rem;
    line-height: 1.6;
}

.article-body .details .highlight-box ul li::before {
    content: '✓';
    position: absolute;
    left: 0;
    color: var(--color-brand-light);
    font-weight: bold;
}

/* Files */
.article-body .files h2 {
    color: var(--color-brand);
    margin-top: 2rem;
}

/* Author Bio */
.author-bio {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    background: #f5f7fa;
    padding: 1.8rem;
    border-radius: 12px;
    margin-top: 3rem;
}

.author-avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-brand) 0%, var(--color-brand-light) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 1.5rem;
    font-weight: 700;
    flex-shrink: 0;
}

.author-info h2 {
    color: var(--color-brand);
    font-size: 1.05rem;
    margin: 0 0 0.35rem 0;
}

.author-info {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.55;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.author-info p {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.55;
}

/* Share buttons */
.article-share {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    flex-wrap: wrap;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid #f0f0f0;
}

.share-label {
    font-weight: 600;
    color: var(--color-brand);
    font-size: 0.9rem;
}

.share-btn {
    padding: 0.4rem 1.1rem;
    border-radius: 50px;
    border: 2px solid #e5e7eb;
    background: white;
    color: #555;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.share-btn:hover {
    border-color: var(--color-brand);
    background: var(--color-brand);
    color: white;
}

/* ============================================
   RELATED ARTICLES
   ============================================
*/

#related {
    background: #f5f7fa;
    padding: 3rem 2rem;
}

.related-title {
    font-size: 2rem;
    font-weight: 700;
    color: var(--color-brand);
    margin: 0 0 2rem 0;
    text-align: center;
}

#related .news-listing {
    grid-template-columns: repeat(3, 1fr);
}

/* ============================================
   SEARCH FORM
   ============================================
*/

#articleSearchFormSmall {
    margin-bottom: 20px;
}

#articleSearchFormSmall input[type="text"] {
    width: 100%;
    padding: 12px 15px;
    box-sizing: border-box;
    font-size: 0.9rem;
    border-radius: 8px;
    border: 1px solid #ddd;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    font-family: var(--font-family);
}

#articleSearchFormSmall input[type="text"]:focus {
    border-color: var(--color-brand);
    box-shadow: 0 0 0 3px rgba(19, 80, 45, 0.1);
    outline: none;
}

#articleSearchFormSmall input[type="submit"] {
    display: none;
}

.NewsArticles #articleSearchForm {
    display: none;
}

/* ============================================
   RESPONSIVE VIDEO
   ============================================
*/

.video-container {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
    overflow: hidden;
    max-width: 100%;
    margin: 1.5rem 0;
    border-radius: 8px;
}

.video-container iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

/* ============================================
   PAGING
   ============================================
*/

.PagingTable {
    width: 100%;
    margin-top: 2rem;
}

.PagingTable a {
    color: var(--color-brand);
    text-decoration: none;
    padding: 6px 12px;
    border-radius: 6px;
    transition: background 0.2s ease;
}

.PagingTable a:hover {
    background: rgba(19, 80, 45, 0.08);
}

/* ============================================
   RESPONSIVE
   ============================================
*/

@media screen and (max-width: 1200px) {
    .news-listing {
        grid-template-columns: repeat(2, 1fr);
    }

    #related .news-listing {
        grid-template-columns: repeat(2, 1fr);
    }

    .article-layout {
        grid-template-columns: 1fr 300px;
        gap: 2rem;
    }

    .PagingTable, .PagingTable tr, .PagingTable td, .PagingTable tbody {
        display: block;
        text-align: center;
    }

    .PagingTable td {
        padding: 10px 0;
    }
}

@media screen and (max-width: 968px) {
    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        order: 1;
    }
}

@media screen and (max-width: 768px) {
    .news-listing {
        grid-template-columns: 1fr;
    }

    #related .news-listing {
        grid-template-columns: 1fr;
    }

    .related-title {
        font-size: 1.4rem;
    }

    .article-body {
        padding: 2rem 1.5rem;
    }

    .author-bio {
        flex-direction: column;
        text-align: center;
    }

    .article-share {
        flex-direction: column;
        align-items: flex-start;
    }

    .PagingTable, .PagingTable td, .PagingTable tr {
        display: block;
    }

    .PagingTable td[align="right"] {
        max-width: 100%;
        overflow-y: hidden;
        overflow-x: scroll;
        height: auto;
    }

    .PagingTable a {
        padding: 2px;
    }
}

@media screen and (max-width: 600px) {
    .article-body .details .alignleft, .article-body .details .alignright {
        display: block;
        float: none;
        margin: 0 auto 20px auto;
        text-align: center;
    }
}
